<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    {if $admin.is_pingtai==1}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">所属运营区:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-area_id" data-rule="required" data-source="vppz/area/index" class="form-control selectpage" name="row[area_id]" type="text" value="{$row.area_id|htmlentities}">
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">社区名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">社区类型</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox">
            {foreach name="types" item="vo"}
            <label for="row[type][]-{$key}"><input id="row[type][]-{$key}" name="row[type][]" type="checkbox" value="{$key}" {in name="key" value="$row.type"}checked{/in} /> {$vo}</label>
            {/foreach}
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">联系方式:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-contact_phone" data-rule="required" class="form-control" name="row[contact_phone]" type="text" value="{$row.contact_phone|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">宣传照片:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-cover_image" data-rule="required" class="form-control" size="50" name="row[cover_image]" type="text" value="{$row.cover_image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-cover_image" class="btn btn-danger faupload" data-input-id="c-cover_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-cover_image" class="btn btn-primary fachoose" data-input-id="c-cover_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-cover_image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-cover_image"></ul>
        </div>
    </div>

	<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">所在区域:</label>
        <div class="col-xs-12 col-sm-8">
            <div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value="{$row.province|htmlentities}/{$row.city|htmlentities}/{$row.district|htmlentities}"></div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">医院位置:</label>
        <div class="col-xs-12 col-sm-8">
			<div class="input-group">
				<div class="input-group-addon">经度</div>
				<input id="c-lng" data-rule="required" class="form-control" name="row[lng]" type="number" value="{$row.lng|htmlentities}">
				<div class="input-group-addon">纬度</div>
                <input id="c-lat" data-rule="required" class="form-control"  name="row[lat]" type="number" value="{$row.lat|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" class="btn btn-primary" data-input-id="c-address" data-toggle="addresspicker" data-lat-id="c-lat" data-lng-id="c-lng"><i class="fa fa-map-marker"></i> 选择位置</button></span>
                </div>
            </div>
        </div>
    </div>

	<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">详细地址:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
        </div>
    </div>

	<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">办公时间:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-service_hours" data-rule="required" class="form-control selectpicker" multiple="" name="row[service_hours][]">
                {foreach name="service_hours" item="vo"}
                    <option value="{$vo.id}" {in name="vo.selected" value="1"}selected{/in}>{$vo.start}-{$vo.end}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">社区详情:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" class="form-control editor" rows="5" name="row[description]" cols="50">{$row.description|htmlentities}</textarea>
        </div>
    </div>
    {if $admin.is_pingtai == 1}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">权重:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="text" value="{$row.weigh}">
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">社区状态:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label>
                    <input name="row[status]" type="radio" value="open" {in name="$row.status" value="open"}checked{/in}> 启用
                </label>
            </div>
            <div class="radio">
                <label>
                    <input name="row[status]" type="radio" value="closed" {in name="$row.status" value="closed"}checked{/in}> 关闭
                </label>
            </div>
            <div class="radio">
                <label>
                    <input name="row[status]" type="radio" value="maintenance" {in name="$row.status" value="maintenance"}checked{/in}> 维护中
                </label>
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
